package com.deep.mybatis.v2.service.impl;

import com.dysf.dao.IUserDao;
import com.dysf.entity.User;
import com.dysf.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author dysfzl
 * @Date 2022-01-09 15:22
 * @Copyright xx科技有限公司 Copyright (c)
 * @Version 1.0
 */
@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    IUserDao userDao;

    @Override
    public void insert(User user) {
        userDao.insert(user);
        System.out.println("spring jdbcTemplate成功插入一条数据！");
    }

    @Override
    public void insertBatch(List<Object[]> list) {
        userDao.insertBatch(list);
        System.out.println("spring jdbcTemplate成功插入多条数据！");
    }

    @Override
    public void insertMap(Map<String, Object> map) {
        userDao.insertMap(map);
        System.out.println("spring namedParameterJdbcTemplate成功插入一条数据！");
    }
}
